﻿using System;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace NiuX.Dapper.Abstractions;

public interface DbCommand<T>
{
    int Update(T entity);

    Task<int> UpdateAsync(T entity);

    int Update(Expression<Func<T, T>> updateExpression);

    Task<int> UpdateAsync(Expression<Func<T, T>> updateExpression);

    int Delete();

    Task<int> DeleteAsync();

    int Insert(T entity);

    Task<int> InsertAsync(T entity);
}